package com.zengjianjun.hive.demo.controller;

import com.zengjianjun.hive.demo.common.R;
import com.zengjianjun.hive.demo.entity.hive.HiveUser;
import com.zengjianjun.hive.demo.entity.mysql.User;
import com.zengjianjun.hive.demo.service.hive.HiveUserService;
import com.zengjianjun.hive.demo.service.mysql.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author zengjianjun
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;

    @Resource
    private HiveUserService hiveUserService;

    @GetMapping("/mysql/findList")
    public R<List<User>> mysql() {
        List<User> list = userService.findList();
        return R.ok(list);
    }

    @GetMapping("/hive/findList")
    public R<List<HiveUser>> hive() {
        List<HiveUser> list = hiveUserService.findList();
        return R.ok(list);
    }
}
